package org.redis.cluster.loadbalance.slot;

import org.redis.cluster.Configs;

public class SlotHelper {

	/**
	 * @param index
	 * @return
	 */
	public static String getSlotIndexPath(Object index) {
		return getSlotPath(SlotConstants.INDEX_PATH+Configs.DEFAULT_REGISTRY_CONNECTOR+index);
	}
	
	/**
	 * @param id
	 * @return
	 */
	public static String getSlotReplicatePath(Object id) {
		return getSlotPath(SlotConstants.REPLICATE_PATH+Configs.DEFAULT_REGISTRY_CONNECTOR+id);
	}
	
	/**
	 * @param clientId
	 * @return
	 */
	public static String getSlotMappingPath(String clientId) {
		return getSlotPath(SlotConstants.MAPPING_PATH+Configs.DEFAULT_REGISTRY_CONNECTOR+clientId);
	}
	
	/**
	 * @param index
	 * @return
	 */
	public static String getSlotPath(Object path) {
		return SlotConstants.ROOT_PATH+path;
	}
}